<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.sql.*,java.io.*,javax.servlet.*,javax.servlet.http.*,java.sql.Connection,java.sql.DriverManager,java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.*" %> 
<%@ page import="java.io.*" %> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>Data from the table 'volunteer' of database 'ocms'</h1>
<%try
{

ResultSet rs;
Connection con =org.tmad.ocms.dao.ConnectionManager.getDbConnection();
Statement stmt =con.createStatement();
 rs =stmt.executeQuery("select * from volunteer ");
%>
<TABLE cellpadding="15" border="1" style="background-color: #ffffcc;"> 
<TR><TH>NAME</TH>
<TH>DATE OF BIRTH</TH>
<TH>ADDRESS</TH>
<TH>CITY</TH>
<TH>EMAILID</TH></TR>
<% 
while (rs.next()) 
{ 
%> 
 <TR> 
<TD><%=rs.getString(4)%></TD> 
<TD><%=rs.getString(14)%></TD> 
<TD><%=rs.getString(6)%></TD> 
<TD><%=rs.getString(13)%></TD> 
<TD><%=rs.getString(2)%></TD> 
</TR>
<% 
} 

%> 
<% 

// close all the connections.

} 
catch (Exception ex) 
{ 
%> 
<font size="+3" color="red"></b> 
<% 
out.println("Unable to connect to database."); 
} 
%> 
</font> 
</TABLE> 
</body> 
</html>


